#include <IRremote.h>

int ledPin = 6;
int outPin = 8;

IRrecv irrecv(outPin);

decode_results results;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Enabling IRin");
  irrecv.enableIRIn();
  Serial.println("Enabled IRin");

}

void loop() {
  // put your main code here, to run repeatedly:
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume();
    digitalWrite(ledPin, HIGH);
  }
  else {
    //Serial.println("recv error");
  }
  delay(300);

  if (results.value == 0xFF30CF || results.value == 0x44BB9966) {
    digitalWrite(ledPin, HIGH);
  }
  else if (results.value == 0xFF18E7 || results.value == 0x44BB837C) {
    digitalWrite(ledPin, LOW);
  }

}
